package com.raquel.conversor;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
/**
 * Main activity for Conversor App
 * @author raquel_valenzuela
 *
 */
public class MainActivity extends Activity {
	private TextView textViewResult;
	private TextView textView;
	private EditText editText;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textViewResult = (TextView) findViewById(R.id.textView2);
        textView = (TextView) findViewById(R.id.textView1);
        editText = (EditText) findViewById(R.id.editText1);
        textViewResult.setText("Witness Hell");
    }
    public void convert (View v){
    	System.out.println("You clicked the button");
    	Log.d("Raquel", "Button click");
    	double result = Double.parseDouble(editText.getText().toString())/166.386;
    	textViewResult.setText(result+ " Euros");
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
}
